DIR = hash cache dns robot
TEST_DIR = dns robots
all: build

build:
	for d in $(DIR); do (cd src/$$d; make clean && make && make install > /dev/null); done
test:
	for d in $(TEST_DIR); do (cd test/$$d; make clean && make > /dev/null); done

unit_test:
	for d in $(DIR); do (cd src/$$d; make test); done

force-install:
	for d in $(DIR); do (cd src/$$d; make install); done

clean:
	rm -rf lib/*.a lib/*.so
	rm -rf test/$$d/*.o test/$$d/*.a test/$$d/*.so test/$$d/*~ test/$dd/test test/$dd/core
	for d in $(DIR); do (cd src/$$d; make clean); done
